see: https://bugzilla.mozilla.org/show_bug.cgi?id=911546

diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
index e700759..519b571 100644
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -4460,6 +4460,10 @@ nsWindow::GrabPointer(guint32 aTime)
         // A failed grab indicates that another app has grabbed the pointer.
         // Check for rollup now, because, without the grab, we likely won't
-        // get subsequent button press events.
-        CheckForRollup(0, 0, false, true);
+        // get subsequent button press events. Do this with an event so that
+        // popups don't rollup while potentionally adjusting the grab for
+        // another popup.
+        nsCOMPtr<nsIRunnable> event =
+            NS_NewRunnableMethod(this, &nsWindow::CheckForRollupDuringGrab);
+        NS_DispatchToCurrentThread(event);
     }
 }
diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h
index 8f89777..a71a787 100644
--- a/widget/gtk/nsWindow.h
+++ b/widget/gtk/nsWindow.h
@@ -371,4 +371,9 @@ private:
     bool               CheckForRollup(gdouble aMouseX, gdouble aMouseY,
                                       bool aIsWheel, bool aAlwaysRollup);
+    void               CheckForRollupDuringGrab()
+    {
+      CheckForRollup(0, 0, false, true);
+    }
+
     bool               GetDragInfo(mozilla::WidgetMouseEvent* aMouseEvent,
                                    GdkWindow** aWindow, gint* aButton,
